/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.ex;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

/**
 * <p>Project: javaseapp - Ex01
 * <p>Powered by webrx On 2021-09-01 08:40:59
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ex01 {
    public static void main(String[] args) {
        //打印出java.lang.String类的所有方法名称
        var s = String.class;
        var ms = s.getDeclaredMethods();
        StringBuilder sbu = new StringBuilder();
        int rows = 0;
        for (Method m : ms) {
            var p = m.getParameters();
            for (Parameter pa : p) sbu.append(pa.getType()).append(" ").append(pa.getName()).append(",");
            if (sbu.length() > 0) sbu.deleteCharAt(sbu.length() - 1);
            System.out.printf("%d、String.%s(%s);%n", ++rows, m.getName(), sbu);
            sbu.delete(0, sbu.length());
        }
    }
}
